<extend name="Public/base"/>

<block name="body">
<style>
.datetimepicker-days thead tr th{background: none !important;}
</style>
	<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>修改内容</h2>
    </div>
    <ul class="tab-nav nav">


        <li class="current"><a href="javascript:void(0)">基本信息</a></li>
		<li><a href="javascript:void(0)">其他信息</a></li>

    </ul>
    
    <form action="{:U()}" method="post" class="form-horizontal">
        <input type="hidden" name="fenlid" value="{$_GET[typeid]}"/>
    <div class="tab-content">
        <div class="form-item">
            <label class="item-label">内容标题：<span class="check-tips">（标题必须填写）</span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="{$vo.title}">
                <input type="hidden" name="id" value="{$vo.id}" />
            </div>
        </div>


       
        <div class="form-item">
            <label class="item-label">内容类别：<span class="check-tips">（类别必须选择）</span></label>
            <div class="controls">
				<select name="typeid" style="width:200px;">
					<option value="">请选择类别</option>
					<volist name="lists" id="typelist">
						<option value="{$typelist.id}" <if condition="$vo.typeid eq $typelist['id']">selected="selected"</if>>{$typelist.html}{$typelist.title}</option>
					</volist>
				</select>
			</div>
        </div>
		
		<div class="form-item">
            <label class="item-label">发布时间</label>
            <div class="controls">
                 <input type="text" class="text input-large" name="create_time" id="deadline2" value="{$vo.create_time|date='Y-m-d H:i',###}">
            </div>
        </div>

        <div class="form-item">
            <label class="item-label">排序</label>
            <div class="controls">
                <input type="text" class="text input-large" name="sort" value="{$vo.sort}">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">浏览量</label>
            <div class="controls">
                <input type="text" class="text input-large" name="view" value="{$vo.view}">
            </div>
        </div>

       
        <div class="form-item">
            <div class="controls">
                <label class="item-label">缩略图：</label>
                <input type="file" id="upload_picture">
                <input type="hidden" name="icon" id="icon" value="{$vo['icon']|default=''}"/>
                <div class="upload-img-box">
                <notempty name="vo['icon']">
                    <div class="upload-pre-item"><img src="__ROOT__{$vo.icon|get_cover='path'}"/></div>
                </notempty>
                </div>
            </div>
            <script type="text/javascript">
            //上传图片
            /* 初始化上传插件 */
            $("#upload_picture").uploadify({
                "height"          : 30,
                "swf"             : "__STATIC__/uploadify/uploadify.swf",
                "fileObjName"     : "download",
                "buttonText"      : "上传图片",
                "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
                "width"           : 120,
                'removeTimeout'	  : 1,
                'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
                "onUploadSuccess" : uploadPicture,
                'onFallback' : function() {
                    alert('未检测到兼容版本的Flash.');
                }
            });
            function uploadPicture(file, data){
                var data = $.parseJSON(data);
                var src = '';
                if(data.status){
                    $("#icon").val(data.id);
                    src = data.url || '__ROOT__' + data.path;
                    $("#icon").parent().find('.upload-img-box').html(
                        '<div class="upload-pre-item"><img src="' + src + '"/></div>'
                    );
                } else {
                    updateAlert(data.info);
                    setTimeout(function(){
                        $('#top-alert').find('button').click();
                        $(that).removeClass('disabled').prop('disabled',false);
                    },1500);
                }
            }
            </script>
        </div>
		

		

        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </div>
    <div class="tab-content" style="display:none;">

        <div class="form-item">
            <label class="item-label">描述：</label>
            <div class="controls">
                <label class="textarea" style="width:400px;">
                    <textarea name="descriptions" >{$vo.descriptions}</textarea>
                </label>
            </div>
        </div>


        <div class="form-item">
            <label class="item-label">内容：</label>
            <div class="controls">
                <label class="textarea">
                    <textarea name="content">{$vo.content}</textarea>
                    {:hook('adminArticleEdit', array('name'=>content,'value'=>$vo['content']))}
                </label>
            </div>
        </div>




        <div class="form-item">
            <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    
    </div>
    </form>

    <input type="hidden" id="news_navs" value="{$controller_name}">
</block>

<block name="script">
<include file="Public:datetime" />
    <script type="text/javascript">
	
		$('.tab-nav li').click(function(){
			$(this).attr('class','current')
						.siblings().attr('class','');
			var n_index=$('.tab-nav li').index(this);
				$('.tab-content').eq(n_index).show()
							 .siblings().hide();
		});
	
        //导航高亮
        highlight_subnav('{:U('news/index')}');
		
		$('#deadline').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });
		$('#deadline2').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });

        if($("#news_navs").val()=='news'){
            $('.side-sub-menu').find('a[href="/index.php?s=/Admin/news/index.html"]').closest('li').addClass('current');
        }
    </script>
</block>
